package cn.com.nong.dao.impl;

import cn.com.nong.bean.ChatUsers;
import cn.com.nong.dao.IChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class ChatServiceImpl implements IChatService {
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Override
    public List<Map<String, Object>> getChatUserList() {
        String sql = "select * from chat_user_info order by unread_count,last_time desc";
        List<ChatUsers> result = new ArrayList<>();
        Object[] params = new Object[]{};
        List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql, params);
        return maps;
    }
}
